package com.ygou.controller;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;

import com.ygou.utils.FileUDUtil;

@Controller
public class FileController {
	@RequestMapping(value="/updGoodsImg")
	public @ResponseBody boolean upLoad(HttpServletRequest request){
		FileUDUtil.UPLOADDIR="/filecontent/goodsimgs/";
		FileUDUtil.FILENAME.clear();
		int t = FileUDUtil.upload(request);
		
		if(t==0){
			return true;
		}
		return false;
	}
	
	@RequestMapping(value="/insertSlideImg")
	public @ResponseBody boolean upLoadSlide(HttpServletRequest request){
		FileUDUtil.UPLOADDIR="/filecontent/slide/";
		FileUDUtil.FILENAME.clear();
		int t = FileUDUtil.upload(request);
		
		if(t==0){
			return true;
		}
		return false;
	}
}
